package com.itheima.d8_test;


import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.Charset;

public class demo01 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("新手.txt", Charset.forName("GBK"));
        FileWriter fw = new FileWriter("哈哈.txt", Charset.forName("GBK"));
        int read;
        while ((read = fr.read()) != -1) {
            System.out.print((char) read);
            fw.write(read);
        }
        fr.close();
        fw.close();
    }
}
